// import { addUserUsingPost } from '@/services/backend/userController';
import '@umijs/max';
import { Button, Modal } from 'antd';
import React from 'react';
import { history } from 'umi';

interface Props {
  modalVisible: boolean;
  onSubmit: () => void;
  onCancel: () => void;
}

const CreateModal: React.FC<Props> = (props) => {
  const { modalVisible, onSubmit, onCancel } = props;

  return (
    <Modal
      title={'必要信息补充'}
      open={modalVisible}
      destroyOnClose
      onCancel={onCancel}
      footer={[
        <Button
          key="toBasicConfiguration"
          type="primary"
          onClick={() => {
            //关闭弹窗
            onSubmit();
            //跳转到基础配置页面
            history.push('/basicConfiguration');
          }}
        >
          去完善
        </Button>,
        <Button key="back" onClick={onCancel}>
          取消
        </Button>,
      ]}
    >
      检测到系统运行时的必要信息尚未完善，请补充完成后再进行此操作
    </Modal>
  );
};
export default CreateModal;
